package org.flashbrighton.as3bots.events
{
	import flash.events.Event;
	
	/**
	 * 
	 * This event is dispatched regularly to inform the bot of the nearest bomb around the bot.
	 * 
	 */
	public class BombSensorEvent extends Event
	{
		public static const BOMB_SENSOR:String = "BombSensor";

		private var _direction:Number;		
		private var _distance:Number;		
		
		public function BombSensorEvent(direction:Number, distance:Number)
		{
			super(BOMB_SENSOR);
			_direction = direction;
			_distance = distance;
		}
		
		/** 
		 * returns the direction of the nearest gem
		 * a value between -1 and 1.
		 * 0 meaning right in front of the head of the bot, 
		 * -1 or 1 the back, 
		 * 0.5 the right side and -0.5 the left one...
		 * 
		 */
		public function get direction():Number
		{
			return _direction;
		}		

		/** 
		 * returns the distance of the nearest gem in meters
		 * the arena is about 10 by 10 meters.
		 * 
		 */
		public function get distance():Number
		{
			return _distance;
		}		
		
	}
}